package com.molichuxing.job;

import com.molichuxing.service.StatisticsOrderService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: renzhengyu
 * @Description: 昨天专属订阅数量
 * @Date: Created in 17:24 2019/11/18
 * @Modified By:
 **/
@JobHandler(value="statisticsYesterdayOrderHandler")
@Component
public class StatisticsYesterdayOrderHandler extends IJobHandler {
    private static final Logger log = Logger.getLogger(StatisticsYesterdayOrderHandler.class);

    @Resource
    private StatisticsOrderService statisticsOrderService;

    public StatisticsYesterdayOrderHandler() {
        super();
    }

    @Override
    public void init() {
        super.init();
    }

    @Override
    public void destroy() {
        super.destroy();
    }


    @Override
    public ReturnT<String> execute(String s) throws Exception {
        ReturnT<String> returnT = ReturnT.SUCCESS;
        log.info("==============================首页订单统计 昨天专属订阅数量数据   开始定时任务");
        Boolean result = statisticsOrderService.yesterdayOrderCount(1);
        log.info("==============================首页订单统计 昨天专属订阅数量数据  结束定时任务result：");
        returnT.setContent("首页订单统计 昨天专属订阅数量数据 定时任务的任务结果result："+ result);
        return returnT;
    }
}
